package com.example.mapper;

import com.example.entity.Article;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ArticleMapper {
    @Select("select * from student.news where name like concat('%',#{name},'%') and username like concat('%',#{username},'%') order by id desc")
    List<Article> seleContent(Article article);
    @Insert("insert into student.news (title,content,name,time,username) value (#{title},#{content},#{name},#{time},#{username})")
    void add(Article article);
    @Delete("DELETE from student.news where id = #{id}")
    void deleteById(Integer id);
    @Update("UPDATE student.news SET title = #{title},content = #{content},name = #{name},time = #{time},username = #{username} where id = #{id}")
    void update(Article article);
}
